# Check this stuff out later
# if machine does not contain setuptools this stuff downloads it automaticly.
#
import os
import distribute_setup
distribute_setup.use_setuptools()

from setuptools import setup
from setuptools import find_packages
from TestRunner import TestRunner
import py2exe

test = TestRunner()

if (not test):
    print "One or more tests were unsuccessful, canceling installation."
    raw_input("Press any key to continue.")
    exit(1)
print "All tests were successul, continuing installation"

#committing project as tests were successfull
if os.path.isdir('.\.svn'):
	try:
		import subprocess
		print 'Attempting automatic commiting'
		subprocess.call(['svn', 'commit', '-m',  '\"Tests successfull, automatic commit\"'])
	except Exception:
		print 'Subversion not found or you don\'t have permission to commit'

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(name='tictactoe',
    version='1.0',
    packages= find_packages(),
    console= ['gamecreator.py'],
    #options = {'py2exe': {'bundle_files': 3}},
    zipfile = None,   
    author = 'Hopur 42',
    author_email = 'hopur42@babbelfish.com',
    description = 'A simple TicTacToe game in console',
    long_description= read('README.txt'),
    download_url = 'http://hopur-42.googlecode.com/svn/trunk/',
    platforms = ['Windows XP and later release']
)

 

